package com.wms.function.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wms.function.mapper.TbTransPayMapper;
import com.wms.function.domain.TbTransPay;
import com.wms.function.service.ITbTransPayService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Arrays;

/**
 * 运费Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-23
 */
@Service
public class TbTransPayServiceImpl extends ServiceImpl<TbTransPayMapper,TbTransPay> implements ITbTransPayService {
    @Autowired
    private TbTransPayMapper tbTransPayMapper;

    /**
     * 查询运费
     *
     * @param id 运费主键
     * @return 运费
     */
    @Override
    public TbTransPay selectTbTransPayById(Long id) {
                return getById(id);
    }

    /**
     * 查询运费列表
     *
     * @param tbTransPay 运费
     * @return 运费
     */
    @Override
    public List<TbTransPay> selectTbTransPayList(TbTransPay tbTransPay) {
        return tbTransPayMapper.selectTbTransPayList(tbTransPay);
    }

    /**
     * 新增运费
     *
     * @param tbTransPay 运费
     * @return 结果
     */
    @Override
    public int insertTbTransPay(TbTransPay tbTransPay) {
                                                                return save(tbTransPay) ? 1 : 0;
    }

    /**
     * 修改运费
     *
     * @param tbTransPay 运费
     * @return 结果
     */
    @Override
    public int updateTbTransPay(TbTransPay tbTransPay) {
                                                        return updateById(tbTransPay) ? 1 : 0;
    }

    /**
     * 批量删除运费
     *
     * @param ids 需要删除的运费主键
     * @return 结果
     */
    @Override
    public int deleteTbTransPayByIds(Long[] ids) {
                return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    /**
     * 删除运费信息
     *
     * @param id 运费主键
     * @return 结果
     */
    @Override
    public int deleteTbTransPayById(Long id) {
                return removeById(id) ? 1 : 0;
    }

}
